package com.ylr.send.common.vo;

import com.ylr.base.common.enums.AesEnum;
import lombok.Getter;
import lombok.ToString;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Map;

/**
 * Created by IntelliJ IDEA.
 *
 * @author wyw
 * date: 2023-06-15 15:44:55
 * className: SendSmsVo
 * version: 1.0
 * description:
 */
@Getter
@ToString
public class SendSmsVo {

    /**
     * 短信模板
     */
    @NotBlank(message = "短信模板不能为空")
    private String code;

    /**
     * 接收手机号
     */
    @NotBlank(message = "接收手机号不能为空")
    private String mobile;

    /**
     * 手机号类型[0-明文 1-hex密文 2-base64密文]
     */
    private Integer mobileType;

    /**
     * 模板参数
     */
    @NotNull(message = "模板参数不能为空")
    private Map<String, String> paramMap;

    public void setCode(String code) {
        this.code = code;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
        this.mobileType = AesEnum.PLAIN.getValue();
    }

    public void setMobile(String mobile, AesEnum cipherEnum) {
        this.mobile = mobile;
        this.mobileType = cipherEnum.getValue();
    }

    public void setParamMap(Map<String, String> paramMap) {
        this.paramMap = paramMap;
    }

}
